package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.UserCourseRecordsMapper;
import com.ruoyi.system.domain.UserCourseRecords;
import com.ruoyi.system.service.IUserCourseRecordsService;

/**
 * 用户-课程参与记录Service业务层处理
 * 
 * @author zrj
 * @date 2025-07-14
 */
@Service
public class UserCourseRecordsServiceImpl implements IUserCourseRecordsService 
{
    @Autowired
    private UserCourseRecordsMapper userCourseRecordsMapper;

    /**
     * 查询用户-课程参与记录
     * 
     * @param recordId 用户-课程参与记录主键
     * @return 用户-课程参与记录
     */
    @Override
    public UserCourseRecords selectUserCourseRecordsByRecordId(Long recordId)
    {
        return userCourseRecordsMapper.selectUserCourseRecordsByRecordId(recordId);
    }

    /**
     * 查询用户-课程参与记录列表
     * 
     * @param userCourseRecords 用户-课程参与记录
     * @return 用户-课程参与记录
     */
    @Override
    public List<UserCourseRecords> selectUserCourseRecordsList(UserCourseRecords userCourseRecords)
    {
        return userCourseRecordsMapper.selectUserCourseRecordsList(userCourseRecords);
    }

    /**
     * 新增用户-课程参与记录
     * 
     * @param userCourseRecords 用户-课程参与记录
     * @return 结果
     */
    @Override
    public int insertUserCourseRecords(UserCourseRecords userCourseRecords)
    {
        userCourseRecords.setCreateTime(DateUtils.getNowDate());
        return userCourseRecordsMapper.insertUserCourseRecords(userCourseRecords);
    }

    /**
     * 修改用户-课程参与记录
     * 
     * @param userCourseRecords 用户-课程参与记录
     * @return 结果
     */
    @Override
    public int updateUserCourseRecords(UserCourseRecords userCourseRecords)
    {
        userCourseRecords.setUpdateTime(DateUtils.getNowDate());
        return userCourseRecordsMapper.updateUserCourseRecords(userCourseRecords);
    }

    /**
     * 批量删除用户-课程参与记录
     * 
     * @param recordIds 需要删除的用户-课程参与记录主键
     * @return 结果
     */
    @Override
    public int deleteUserCourseRecordsByRecordIds(Long[] recordIds)
    {
        return userCourseRecordsMapper.deleteUserCourseRecordsByRecordIds(recordIds);
    }

    /**
     * 删除用户-课程参与记录信息
     * 
     * @param recordId 用户-课程参与记录主键
     * @return 结果
     */
    @Override
    public int deleteUserCourseRecordsByRecordId(Long recordId)
    {
        return userCourseRecordsMapper.deleteUserCourseRecordsByRecordId(recordId);
    }
}
